package dem1;

import java.util.Arrays;
import java.util.Comparator;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-03-21
 * Time: 20:11
 */

class Student{
    int age;
    int num;

    public Student(int age, int num) {
        this.age = age;
        this.num = num;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", num=" + num +
                '}';
    }
}

public class Test {
    public static void main(String[] args) {
        Student[] student = new Student[3];
        student[0] = new Student(10,10);
        student[1] = new Student(18,19);
        student[2] = new Student(12,12);

        Arrays.sort(student, new Test2());
        System.out.println(Arrays.toString(student));
    }
}
